package com.genius.action;

import java.util.List;

import com.genius.core.manager.StudentManager;
import com.genius.model.BatchCounter;
import com.genius.model.StudentWrapper;
import com.opensymphony.xwork.ActionSupport;

public class DashboardAction extends ActionSupport
{
    List batchList = null;
    
    List studentList = null;
    
    StudentWrapper studentCounter = null;
    
    BatchCounter batchCounter = null;
    
    private StudentManager studentManager = null;

    /**
     * @return Returns the studentManager.
     */
    public StudentManager getStudentManager()
    {
        return studentManager;
    }
    /**
     * @param studentManager The studentManager to set.
     */
    public void setStudentManager(StudentManager studentManager)
    {
        this.studentManager = studentManager;
    }
    /**
     * @see com.opensymphony.xwork.ActionSupport#execute()
     */
    public String showDashboard() throws Exception
    {
        studentList = this.studentManager.searchStudent("", "");
        studentCounter = new StudentWrapper(studentList);
        batchList = this.studentManager.getBatchList(-1);
        batchCounter = new BatchCounter(batchList);
        //Returns page with student entry form
        return this.SUCCESS;
    }
    /**
     * @return Returns the batchList.
     */
    public List getBatchList()
    {
        return batchList;
    }

    /**
     * @param batchList The batchList to set.
     */
    public void setBatchList(List batchList)
    {
        this.batchList = batchList;
    }

    /**
     * @return Returns the studentList.
     */
    public List getStudentList()
    {
        return studentList;
    }

    /**
     * @param studentList The studentList to set.
     */
    public void setStudentList(List studentList)
    {
        this.studentList = studentList;
    }
    /**
     * @return Returns the studentCounter.
     */
    public StudentWrapper getStudentCounter()
    {
        return studentCounter;
    }
    /**
     * @param studentCounter The studentCounter to set.
     */
    public void setStudentCounter(StudentWrapper studentCounter)
    {
        this.studentCounter = studentCounter;
    }
    /**
     * @return Returns the batchCounter.
     */
    public BatchCounter getBatchCounter()
    {
        return batchCounter;
    }
    /**
     * @param batchCounter The batchCounter to set.
     */
    public void setBatchCounter(BatchCounter batchCounter)
    {
        this.batchCounter = batchCounter;
    }
    
}
